package com.mrd.gtimp.business.repository;

import com.mrd.gtimp.business.entity.Attachment;
import com.mrd.spring.repository.BaseRepository;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * <p> application name: gtimp <p> copyright: Copyright@2012 明睿达科技有限公司
 */

/**
 * @author luob
 */
public interface AttachmentDao extends BaseRepository<Attachment,String> {
    @Query("select new com.mrd.gtimp.business.entity.Attachment(t.id, t.name, t.bill_no) from com.mrd.gtimp.business.entity.Attachment t where t.bill_no in (:nos)")
    List<Attachment> findIdAndNameAndBillNoByBillNos(@Param(value = "nos") List<String> nos);

    @Query("select t from com.mrd.gtimp.business.entity.Attachment t where t.bill_no in (:nos)")
    List<Attachment> findByBillNos(@Param(value = "nos") List<String> nos);
}
